<!-- <template>
  <div id="app">
     
   <router-view/>
  <Tabbar></Tabbar>
  </div>
</template> -->
<script>
	import Tabbar from'./components/Tabbar.vue'
	export default {
		 // name: 'App',
		 //  created:function(){
		 //  this.$router.push('/')
		  
		 // },
		 // components:{
		 //  Tabbar
		 // },
		 // App.vue 中监听
　　　　　onLaunch: function(options) {
	// #ifdef H5
			// tabbar中间按钮点击事件
			let params = this.getRequestParams();
			console.log(params)
		 if(!params.token){
			 let url = "http://weikajie.zanboon.com/login/login/wx_login?merchantID=1&page=" 
			 location.href = url
			 // console.log(456,encodeURIComponent("/pages/edit/edit"))
		 }
		 //#endif
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		
		methods: {
			getRequestParams() {
				let url = location.href;
				console.log(123,url)
				let requestParams = {};
				https://www.baidu.com?name=yuanxin&age=21
				if (url.indexOf('?') !== -1) {
					let str = url.substr(url.indexOf('?') + 1); //截取?后面的内容作为字符串
					console.log(str, '?后面的内容');
					let strs = str.split('&'); //将字符串内容以&分隔为一个数组
					
					console.log(strs, '以&切割的数组');
					for (let i = 0; i < strs.length; i++) {
						
						requestParams[strs[i].split('=')[0]] = decodeURI(strs[i].split('=')[1]);
						// 将数组元素中'='左边的内容作为对象的属性名，'='右边的内容作为对象对应属性的属性值
					}
				}
				console.log(requestParams, '处理后的对象');
				return requestParams;
			}
		}
	}
</script>

<style>
	
		/*每个页面公共css */
		/* 第三方动画库 */
		@import '/common/animate.css';
		/* 自定义图标库 */
		@import '/common/icon.css';
		@import '/common/free.css';
	
		/* 官方ui库 */
		@import '/common/uni.css';
		/* UI基础库 */
		@import '/common/zcm-main.css';
	
		/*  自定义公共样式 */
		@import '/common/common.css';
	
	/*每个页面公共css */
		@font-face {
		  font-family: "iconfont"; /* Project id 2543838 */
		  src: url('//at.alicdn.com/t/font_2543838_0qmfcm6c784h.woff2?t=1621223988007') format('woff2'),
		       url('//at.alicdn.com/t/font_2543838_0qmfcm6c784h.woff?t=1621223988007') format('woff'),
		       url('//at.alicdn.com/t/font_2543838_0qmfcm6c784h.ttf?t=1621223988007') format('truetype');
		}
		
		.iconfont {
		  font-family: "iconfont" !important;
		  font-size: 16px;
		  font-style: normal;
		  -webkit-font-smoothing: antialiased;
		  -moz-osx-font-smoothing: grayscale;
		}
		
		.icon-jiufuqianbaoicon14:before {
		  content: "\e69b";
		}
		
		.icon-x:before {
		  content: "\e7ce";
		}
		
		.icon-shanchu:before {
		  content: "\e61a";
		}
		
		.icon-gou1:before {
		  content: "\e686";
		}
		
		.icon-ziyuan:before {
		  content: "\e60d";
		}
		
		.icon-xiazai:before {
		  content: "\e6af";
		}
		
		.icon-fanhui:before {
		  content: "\e6cd";
		}
		
		.icon-jiantou:before {
		  content: "\e60e";
		}
</style>
